home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
bas_int1.zip
/
ISFILE@.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-03-12
|
963b
|
31 lines
'==================================================================
'Another Filexist Routine
'Source: FideNet Quick Basic Forum
' Date : 11-Mar-91
' From : Bob Perkins
'==================================================================
'main() 'Sample Main program calling Sub Filexist()
'$INCLUDE: 'QB.BI'
DECLARE SUB Filexist (Filename$, notexist%)
DIM SHARED Regs AS RegType
'
'You will need to start QB with "QB /L" to load the interrupt lib.
'
Filexist "abc.txt", notexist%
IF notexist% THEN PRINT "File does not exist." ELSE PRINT "File exists."
END
'
SUB Filexist (Filename$, notexist%)
'returns 0 in notexist% if file exists, non-zero if it does not...
Testname$ = Filename$ + CHR$(0)
Regs.AX = &H4E00
Regs.cx = &H0
Regs.dx = SADD(Testname$)
CALL interrupt(&H21, Regs, Regs)
notexist% = 0
IF (&H1 AND Regs.flags) <> 0 THEN
notexist% = Regs.AX AND &HF
END IF
END SUB